<?php


namespace app\admin\controller;


use think\exception\ValidateException;

class Common extends Base
{
    /**
     * upload #上传
     * api post /{controller}/{method}
     *
     * @auth kouweihong
     * @date 2020/12/3
     */
    public function upload()
    {
        try {
            $upload = new \UploadFile($this->auth);
            $res = $upload->upload();

            $this->success($res);
        } catch (ValidateException $e) {
            $this->error($e->getMessage());
        }
    }
}